Goal:
Using command to get the password which is stored in the only human-readable file in the 'inhere' directory.
Login command: ssh bandit4@bandit.labs.overthewire.org -p 2220
Password: 2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe
My Solution:
As usual, we used 'ls' to see what we had and 'cd inhere' to enter the directory. Upon entering the 'inhere' directory, we used 'ls'. However, this time there were 10 files in it, from -file00 to -file09. Encountering this unexpected scenario, we revisited the objective. It was then that I noticed the term 'human-readable'. I promptly used 'find inhere -readable', but to my surprise, the output included all ten files. Perplexed by this, I selected one of the files and used the 'cat' command to view its contents. Inside the file were garbled characters, clearly not human-readable text. Returning to the man page, I realized that 'readable' in the 'file' command refers to users having permission to access a file rather than the readability of the file's content. Upon further consideration, I remembered the 'file' command, which can identify the type of a file. By filtering the output, I could identify files encoded in ASCII. Using 'file inhere/*' (where '*' denotes all files), I discovered that only file07 was ASCII-encoded. Therefore, I used 'cat inhere/-file07' and obtained the key.
The Key
lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR
References
https://man7.org/linux/man-pages/man1/find.1.html
https://stackoverflow.com/questions/14505218/finding-human-readable-files-on-unix
https://blog.gtwang.org/linux/unix-linux-find-command-examples/
https://blog.miniasp.com/post/2010/08/27/Linux-find-command-tips-and-notice